package com.common.util;


import java.util.HashMap;
import java.util.Map;

public class Status {

    public final static int SUCCESS = 100;
    public final static int FAILED = 200;
    public final static int BADREQUEST = 300;


    public final static Map<Integer,String> responseMsg = new HashMap<>();

    static {
        responseMsg.put(SUCCESS,"请求成功");
        responseMsg.put(FAILED,"请求失败");
        responseMsg.put(BADREQUEST,"请求错误");
    }

    public static String  getResponseMsg(int status){
        return responseMsg.get(status);
    }
    public static Response  getResponse(int status){
        return new Response(status,responseMsg.get(status),null);
    }

}
